home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 34.zip / BS1 part 34 / Aztec C 5.0a disk 1.adf / include / ctype.h < prev    next >
C/C++ Source or Header  |  1989-07-12  |  1KB  |  54 lines

  1. /* Copyright 1988 Manx Software Systems, Inc.    */
  2. /* All rights reserved.                            */
  3.  
  4. #ifndef __CTYPE_H
  5. #define __CTYPE_H
  6.  
  7. extern char _ctype[];
  8.  
  9. #define    _U    0x01    /* Upper-case    */
  10. #define    _L    0x02    /* Lower-case    */
  11. #define    _D    0x04    /* Decimal-digit */
  12. #define    _H    0x08    /* Hex-digit    */
  13. #define    _W    0x10    /* White-space    */
  14. #define    _C    0x20    /* Control char    */
  15. #define    _P    0x40    /* Punctuation    */
  16. #define    _B    0x80    /* Blank        */
  17.  
  18. int isalpha(int _c);
  19. int isupper(int _c);
  20. int islower(int _c);
  21. int isdigit(int _c);
  22. int isxdigit(int _c);
  23. int isalnum(int _c);
  24. int isspace(int _c);
  25. int ispunct(int _c);
  26. int iscntrl(int _c);
  27. int isprint(int _c);
  28. int isgraph(int _c);
  29. int isascii(int _c);
  30. int tolower(int _c);
  31. int toupper(int _c);
  32.  
  33. #ifdef __C_MACROS__
  34. #define isalpha(x)    ((_ctype+1)[x]&(_L|_U))
  35. #define isupper(x)    ((_ctype+1)[x]&(_U))
  36. #define islower(x)    ((_ctype+1)[x]&(_L))
  37. #define isdigit(x)    ((_ctype+1)[x]&(_D))
  38. #define isxdigit(x)    ((_ctype+1)[x]&(_H))
  39. #define isalnum(x)    ((_ctype+1)[x]&(_L|_U|_D))
  40. #define isspace(x)    ((_ctype+1)[x]&(_W))
  41. #define ispunct(x)    ((_ctype+1)[x]&(_P))
  42. #define iscntrl(x)    ((_ctype+1)[x]&(_C))
  43. #define isprint(x)    ((_ctype+1)[x]&(_P|_L|_U|_D|_B))
  44. #define isgraph(x)    ((_ctype+1)[x]&(_P|_L|_U|_D))
  45. #define isascii(x)    (((x)&0x80)==0)
  46. #endif
  47.  
  48. #define toascii(x) ((x)&0x7f)
  49. #define _tolower(x) ((x)-'a'+'A')
  50. #define _toupper(x) ((x)-'A'+'a')
  51.  
  52. #endif /* _CTYPE_H */
  53.  
  54.